<template>
  <div class="boxs-item">
    <div class="box-left">
      <div class="left-item">
        <div><titles :title="props.info.text" /> <textMax :data="props.info.remarks" :maxLen="56" /></div>
      </div>
      <div class="left-item1" @click="pathChild(props.info.children[0])">
        <div class="text-box">
          <span
            class="title"
            :style="{
              fontSize: store.styleInfo.mintitleSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ props.info.children[0].text }}</span
          >
          <span
            class="left-title1"
            :style="{
              fontSize: store.styleInfo.contentSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ props.info.children[0].remarks }}</span
          >
        </div>
        <img
          @click="pathChild(props.info.children[0])"
          class="left-item1"
          style="margin-top: 0px"
          :src="urls + props.info.children[0].value + '?imageView2/1/w/480/h/380/format/webp'"
          alt=""
          v-if="props.info.children[0].value"
        />

        <img
          @click="pathChild(props.info.children[0])"
          class="left-item1"
          style="margin-top: 0px"
          src="http://101.34.143.36:8890/api/image/387939155165253/h_380,w_480"
          alt=""
          v-else
        />
      </div>
      <div class="left-item2" @click="pathChild(props.info.children[1])">
        <div class="text-box">
          <span
            class="title"
            :style="{
              fontSize: store.styleInfo.mintitleSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ props.info.children[1].text }}</span
          >
          <span
            class="left-title1"
            :style="{
              fontSize: store.styleInfo.contentSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ props.info.children[1].remarks }}</span
          >
        </div>
        <img
          @click="pathChild(props.info.children[1])"
          class="left-item2"
          style="margin-top: 0px"
          :src="urls + props.info.children[1].value + '?imageView2/1/w/480/h/380/format/webp'"
          alt=""
          v-if="props.info.children[1].value"
        />

        <img
          @click="pathChild(props.info.children[1])"
          class="left-item2"
          style="margin-top: 0px"
          src="http://101.34.143.36:8890/api/image/387939155165253/h_380,w_480"
          alt=""
          v-else
        />
      </div>
      <div class="left-item3" @click="pathChild(props.info.children[2])">
        <div class="text-box">
          <span
            class="title"
            :style="{
              fontSize: store.styleInfo.mintitleSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ props.info.children[2].text }}</span
          >
          <span
            class="left-title1"
            :style="{
              fontSize: store.styleInfo.contentSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ props.info.children[2].remarks }}</span
          >
        </div>
        <img
          class="left-item3"
          style="margin-top: 0px"
          @click="pathChild(props.info.children[2])"
          :src="urls + props.info.children[2].value + '?imageView2/1/w/280/h/380/format/webp'"
          alt=""
          v-if="props.info.children[2].value"
        />

        <img
          @click="pathChild(props.info.children[2])"
          class="left-item3"
          style="margin-top: 0px"
          src="http://101.34.143.36:8890/api/image/387939155165253/h_380,w_280"
          alt=""
          v-else
        />
      </div>
    </div>
    <div class="right-item" @click="pathChild(props.info.children[3])">
      <div class="text-box">
        <span
          class="title"
          :style="{
            fontSize: store.styleInfo.mintitleSize,
            fontFamily: store.styleInfo.textFamily,
            color: '#fff',
          }"
          >{{ props.info.children[3].text }}</span
        >
        <span
          class="left-title1"
          :style="{
            fontSize: store.styleInfo.contentSize,
            fontFamily: store.styleInfo.textFamily,
            color: '#fff',
          }"
          >{{ props.info.children[3].remarks }}</span
        >
      </div>
      <img
        @click="pathChild(props.info.children[3])"
        class="left-item3"
        style="margin-top: 0px"
        :src="urls + props.info.children[3].value + '?imageView2/1/w/420/h/380/format/webp'"
        alt=""
        v-if="props.info.children[3].value"
      />

      <img
        @click="pathChild(props.info.children[3])"
        class="left-item3"
        style="margin-top: 0px"
        src="http://101.34.143.36:8890/api/image/387939155165253/h_420,w_380"
        alt=""
        v-else
      />
    </div>
  </div>
</template>

<script setup lang="ts">
// @ts-nocheck
import { pathList, pathListLoop } from '../route';
import { urls } from '@/utils/request/upload';
import titles from '@/components/title/title.vue';
import buttonIcon from '@/components/title/buttonIcon.vue';
import textMax from '@/components/textMax/textMax.vue';
import { onMounted } from 'vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
import UnitImageNull from '@/components/unitImageNull/unitImageNull.vue';
const router = useRouter();
const route = useRoute();
const store = useProjectStore();
const props = defineProps({
  info: {
    type: Object,
  },
});
const pathChild = (e: any) => {
  store.setchildModel(e);
  router.push({
    name: route.meta.loopType ? pathListLoop[8] : pathList[8],
    query: {},
  });
};
</script>

<style lang="less" scoped>
@import './index.less';
.boxs-item {
  display: flex;
  width: 100%;
}
.text-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  .title {
  }
  .left-title1 {
    line-height: 28px;
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden; //溢出内容隐藏
    text-overflow: ellipsis; //文本溢出部分用省略号表示
    display: -webkit-box; //特别显示模式
    -webkit-line-clamp: 3; //行数
    line-clamp: 3;
    -webkit-box-orient: vertical; //盒子中内容竖直排列
  }
}
.right-item:hover {
  .text-box {
    opacity: 1;
  }
}
.left-item1:hover {
  .text-box {
    opacity: 1;
  }
}
.left-item2:hover {
  .text-box {
    opacity: 1;
  }
}
.left-item3:hover {
  .text-box {
    opacity: 1;
  }
}
.box-left {
  display: flex;
  flex-wrap: wrap;
  width: 780px;
}
.right-item {
  position: relative;
  flex: 1;
  height: 420px;
  margin-top: 160px;
  margin-left: 20px;
  img {
    width: 100%;
    height: 420px;
  }
}
.left-item {
  width: 780px;
}
.left-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 360px;
  margin-right: 40px;
}
.left-item1 {
  position: relative;
  width: 380px;
  height: 420px;
}
.left-item2 {
  position: relative;
  width: 480px;
  height: 380px;
  margin-right: 20px;
  margin-top: 20px;
}
.left-item3 {
  position: relative;
  width: 280px;
  height: 380px;
  margin-top: 20px;
}
</style>
